from django.shortcuts import render

from .models import *


def get_breadcrumb(cat3):
    """生成面包屑函数"""
    cat2 = cat3.parent
    cat1 = cat2.parent
    cat1.url = cat1.goodschannel_set.all()[0].url
    return {"cat1":cat1,"cat2":cat2,"cat3":cat3}